package com.whcoding.designpatterns.pattern.decorator;

/**
 * @program: spring-boot-learning
 * @description: 测试类
 * @author: whcoding
 * @create: 2022-09-20 15:05
 **/
public class DecoratorTests {


	/**
	 * 操作说明：
	 * 1.添加一个抽象类
	 *
	 *
	 *
	 *
	 * @param args
	 */
	public static void main(String[] args) {
		// 点一份美式咖啡
		DrinkAbstractVO longBlack = new AmericanCoffeeVO();
		System.out.println(longBlack.getDesc() + " 费用: " + longBlack.cost());

		// 添加一点牛奶
		longBlack = new MilkVO(longBlack);
		System.out.println(" 添加了：" + longBlack.getDesc() + " 费用：" + longBlack.cost());

		// 再添加一点焦糖
		longBlack = new CarmaelVO(longBlack);
		System.out.println(" 添加了：" + longBlack.getDesc() + " 费用：" + longBlack.cost());
	}


}
